-- defenser_cannon_reduce2
-- Created by shuzy Oct/09/2016
-- 降低敌方主炮威力，至多30%(魔动光束专用)
-- 100 代表降低10%

local MAX_RATE = 300;  -- 至多30%

return {
    -- 空属性
    getEmptyProp = function()
        return 0;
    end,

    -- 合并属性
    mergeSkyProp = function(data, addon)
        local result = {};

        if not data then
            result = addon;
        else
            result = addon + (data or 0);
        end

        result = math.min(result, MAX_RATE);

        return result;
    end,

    parseDesc = function(desc, data)
        desc = string.gsub(desc, "{rate}", math.modf(data / 10), 1);
        desc = string.gsub(desc, "{max_rate}", math.modf(MAX_RATE / 10), 1);
        return desc;
    end,
};